package dao.impl;

import dao.NewsDao;
import entity.News;
import factory.SimpleDaoFactory;
import service.NewsService;

public class NewsServiceImpl implements NewsService {
    //实例化所依赖的NewsDao对象
    private NewsDao dao = new NewsDaoImpl();

    public void addNews(News news){
        //调用NewsDao的方法保存新闻信息
        dao.save(news);
    }


    private NewsDao dao2;
    public void setDao1(NewsDao dao){
        this.dao2 = dao2;
    }



}
